-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #4124: Boards: Hide tasks from hidden projects #4186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello there davidrr21! 👋
Thank you and congrats 🎉 for opening your first PR on this project! ✨ 💖
We will try to review it soon!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for this! While I generally would like to see this feature, I think I'd prefer if the this would be done on the data mapping level rather, than changing the actual (persisted) model.
@@ -113,6 +113,24 @@ export const taskReducer = createReducer<TaskState>( | |||
}); | |||
}), | |||
|
|||
on(toggleHideFromMenu, (state, { projectId, allTaskIds, isHiddenFromMenu }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather avoid updating the task model itself for this, since it might complicate things further down the road, adds additional data size and logically the hidden state belongs more to the project model, than the task model.
Hi @johannesjo , Apologies for the delay in getting back to this – I’ve now pushed the requested changes to the PR. Please let me know if there’s anything else you’d like me to adjust. Thanks again for your patience! Best regards |
Thank you very much for the adjustments! It seems there are a lot of conflicts. Could you maybe have a look? |
The visibility of each task is in accordance with the visibility of the corresponding project in the boards section
Now the issues related to hidden and backlog are fully handled on the project side, only needing a selector that I created on the tasks side to filter.
Hi @johannesjo , The conflicts should now be fixed. Best regards |
Thank you. |
#4124
The visibility of each task aligns with the visibility of the corresponding project in the boards section.
Description
The issue was that the toggleHideFromMenu function in the project service was never being called, and there was no interaction between the visibility of a project and its associated tasks.
Implementation
I introduced a flag in tasks called unavailable, which changes according to the visibility of the respective project.
Previously, when changing the project's visibility in side-nav.component.html, the toggleProjectVisibility function in side-nav.component.ts was called, directly modifying the isHiddenFromMenu flag of the project.
Now, nav.component.html calls toggleProjectVisibility in side-nav.component.ts, which invokes the projectHideFromMenu service, triggering the toggleHideFromMenu action.
In the project reducer, the isHiddenFromMenu flag is updated, and in the tasks reducer, the unavailable flags of all tasks associated with the project are updated accordingly.
When the board selects tasks to display, it uses a new selector called selectAllAvailableTasksWithSubTasks, which filters only the tasks that are available.